<template>
	<view>

		<cu-custom bgColor="theme-bg-color" :isBack="true">
			<block slot="backText"><text>返回</text></block>
			<block slot="content"><text> 上传人脸 </text></block>
		</cu-custom>
		<face-bio-assay :isDev="false" ref="faceDetect"   @detectFailed="detectFailed" @photoChange="photoChange">
		</face-bio-assay>
	</view>
</template>

<script>
	import faceBioAssay from '@/components/face-bio-assay/components/face-bio-assay/face-bio-assay.vue'
	import store from "@/store";
	import {
		mapGetters
	} from "vuex";

	export default {
		data() {
			return {
				}
		},
		components: {
			faceBioAssay,
		},
		computed: {
			...mapGetters([
				'token', 'RoleTypeFormat', "userInfo", 'location'
			])
		},
		onLoad(option) {
			this.$refs.faceDetect.initData()
		},
		methods: {
			detectFailed() {
				uni.showToast({
					title: "人脸核验失败~",
					icon: 'none'
				})
				uni.navigateBack({
					delta:1
				})
			},

			photoChange(path) {
				uni.navigateBack({
					delta:1
				})
				this.getOpenerEventChannel().emit('data', path);
			}
		}
	}
</script>

<style>

</style>